package com.jf.blogbackened.controller;

import com.alibaba.fastjson.JSON;
import com.jf.blogbackened.bean.Result;
import com.jf.blogbackened.service.IndexService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author David
 */
@RestController
@RequestMapping("/index")
public class IndexController {
    @Resource
    private IndexService indexService;
    @GetMapping("/statistics")
    /**
     * 首页数据统计
     */
    public String getStatistics() {
     Result result =indexService.getStatistics();
     return JSON.toJSONString(result);
    }
}
